{
	template:`
    <m-page @back="back" :title="title">
        <m-top></m-top>
        <m-title>{{title}}
			<template #action>
				<m-button @click="createStoreSettle()">登记</m-button>
			</template>
        </m-title>
		<m-top></m-top>
		<m-list ref="list" :url="url" :params="params" :bottom="0" :search="search">
			<template #item="{item}">
				<m-card join @click="openStoreSettle(item.oid)">
					<div class="flex padding-sm align-center">
                        <div class="cu-tag radius" :class="'bg-'+item.inputStore.color">{{item.inputStore.name}}</div>
                        <div class="padding-lr-sm">结算给</div>
                        <div class="cu-tag radius" :class="'bg-'+item.settleStore.color">{{item.settleStore.name}}</div>
                        <div class="flex-sub text-right padding-right-sm"><span class="text-lg text-red">{{formatAmount(item.settleAmount)}}</span>元</div>
                        <status type="settleStatus" :value="item.status"></status>
					</div>
					<div class="flex align-center text-sm padding-bottom-sm padding-lr-sm">
					    <div class="flex-sub text-right">
                            付款金额：<span class="text-df text-red">{{formatAmount(item.payAmount)}}</span>元，
                            赠送金额：<span class="text-df text-red">{{formatAmount(item.giveAmount)}}</span>元
                        </div>
					</div>
				</m-card>
			</template>
		</m-list>
    </m-page>
	`,
	props: ['param','parentVue'],
	data:function(){
		return {
            title:'店铺结算',
            url:'action/order/storeSettle/getList',
            params:{},
            search:[
            ]
		};
	},
	mounted(){
	},
	methods:{
	    openStoreSettle:function(oid){
	        this.openPage('order/settle/storeSettle.js',{oid:oid},(flag,obj)=>{
	            this.$refs.list.refresh();
	        });
	    },
	    createStoreSettle:function(){
	        this.openPage('common/selectStore.js',{title:'选择要结算的店铺',selectOid:''},(flag,obj)=>{
	            if(flag){
                    this.requestData('action/order/storeSettle/create',
                        {settleStore:obj},
                        (data)=>{
                            if(data.code==0){
                                this.remind().success(data.msg);
                                this.openStoreSettle(data.oid);
                            }else{
                                this.remind().error(data.msg);
                            }
                        }
                    );
                }
	        });
	    }
	}
}